<!DOCTYPE html>
<html lang="zh" xmlns:th="https://www.thymeleaf.org">
<!--只加载通用module-->
<head th:fragment="header(title)">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!--标题-->
    <title th:text="${title}"></title>
    <link rel="shortcut icon" href="/favicon.ico">
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
    <!-- bootstrap-table 表格插件样式 -->
    <link th:href="@{/ajax/libs/bootstrap-table/bootstrap-table.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/animate.css}" rel="stylesheet"/>
    <link th:href="@{/css/style.css}" rel="stylesheet"/>
    <link th:href="@{/dimple/css/ui.css}" rel="stylesheet"/>
</head>

<div th:fragment="footer">
    <script th:src="@{/js/jquery.min.js}"></script>
    <script th:src="@{/js/bootstrap.min.js}"></script>
    <!-- bootstrap-table 表格插件 -->
    <script th:src="@{/ajax/libs/bootstrap-table/bootstrap-table.min.js}"></script>
    <script th:src="@{/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.min.js}"></script>
    <script th:src="@{/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js}"></script>
    <script th:src="@{/ajax/libs/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.min.js}"></script>
    <script th:src="@{/ajax/libs/bootstrap-table/extensions/columns/bootstrap-table-fixed-columns.js}"></script>
    <!-- jquery-validate 表单验证插件 -->
    <script th:src="@{/ajax/libs/validate/jquery.validate.min.js}"></script>
    <script th:src="@{/ajax/libs/validate/messages_zh.min.js}"></script>
    <script th:src="@{/ajax/libs/validate/jquery.validate.extend.js}"></script>
    <!-- jquery-validate 表单树插件 -->
    <script th:src="@{/ajax/libs/bootstrap-treetable/bootstrap-treetable.js}"></script>
    <!-- jquery-export 表格导出插件 -->
    <script th:src="@{/ajax/libs/bootstrap-table/extensions/export/bootstrap-table-export.js}"></script>
    <script th:src="@{/ajax/libs/bootstrap-table/extensions/export/tableExport.js}"></script>
    <!-- 遮罩层 -->
    <script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>

    <script th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script>
    <script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
    <script th:src="@{/ajax/libs/layui/layui.js}"></script>
    <script th:src="@{/dimple/js/common.js}"></script>
    <script th:src="@{/dimple/js/ui.js}"></script>

    <script th:inline="javascript"> var ctx = [[@{
        /}]]; </script>
</div>
<div th:fragment="min862f-css">
    <link th:href="@{/css/main/style.min862f.css}" rel="stylesheet"/>
</div>
<!-- ztree树插件 -->
<div th:fragment="ztree-css">
    <link th:href="@{/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css}" rel="stylesheet"/>
</div>
<div th:fragment="ztree-js">
    <script th:src="@{/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js}"></script>
</div>

<!-- select2下拉框插件 -->
<div th:fragment="select2-css">
    <link th:href="@{/ajax/libs/select2/select2.min.css}" rel="stylesheet"/>
    <link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet"/>
</div>
<div th:fragment="select2-js">
    <script th:src="@{/ajax/libs/select2/select2.min.js}"></script>
</div>

<!-- bootstrap-select下拉框插件 -->
<div th:fragment="bootstrap-select-css">
    <link th:href="@{/ajax/libs/bootstrap-select/bootstrap-select.css}" rel="stylesheet"/>
</div>
<div th:fragment="bootstrap-select-js">
    <script th:src="@{/ajax/libs/bootstrap-select/bootstrap-select.js}"></script>
</div>

<!-- datetimepicker日期和时间插件 -->
<div th:fragment="datetimepicker-css">
    <link th:href="@{/ajax/libs/datapicker/bootstrap-datetimepicker.min.css}" rel="stylesheet"/>
</div>
<div th:fragment="datetimepicker-js">
    <script th:src="@{/ajax/libs/datapicker/bootstrap-datetimepicker.min.js}"></script>
</div>

<!-- ui布局插件 -->
<div th:fragment="layout-latest-css">
    <link th:href="@{/ajax/libs/jquery-layout/jquery.layout-latest.css}" rel="stylesheet"/>
</div>
<div th:fragment="layout-latest-js">
    <script th:src="@{/ajax/libs/jquery-layout/jquery.layout-latest.js}"></script>
</div>

<!-- summernote富文本编辑器插件 -->
<div th:fragment="summernote-css">
    <link th:href="@{/ajax/libs/summernote/summernote.css}" rel="stylesheet"/>
    <link th:href="@{/ajax/libs/summernote/summernote-bs3.css}" rel="stylesheet"/>
</div>
<div th:fragment="summernote-js">
    <script th:src="@{/ajax/libs/summernote/summernote.js}"></script>
    <script th:src="@{/ajax/libs/summernote/summernote-zh-CN.js}"></script>
    <script th:src="@{/ajax/libs/summernote/summernote-ext-highlight.js}"></script>
    <script>
        //图片上传成功回调方法
        function callBackUploadImg(fileUrl){
            $(".summernote").summernote('editor.insertImage', fileUrl, fileUrl);
        }

        var selectImageButton = function (context) {
            var ui = $.summernote.ui;
            // create button
            var button = ui.button({
                contents: '<i class="note-icon-picture"/>',  //按钮样式
                tooltip: "图片",
                click: function (params) {
                	 layer.open({
                         type: 2,
                         shade: 0.3,
                         title: false,
                         fix: false,
                         area: ['auto','420px'],//$(window).width() / 1.1 + 'px'
                         content: "/blog/blog/image?callBackMethod=window.parent.callBackUploadImg",
                         shadeClose: true,// 是否点击遮罩关闭
                         btn: ['<i class="fa fa-check"></i> 确认', '<i class="fa fa-close"></i> 关闭'],
                         yes: function (index, layero) {
                       	    var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
                       	 	iframeWin.uploadFile();
                         },
                         cancel: function () {
                             return true;
                         }
                     });
                },
                callback: function (params) {
                    // 页面加载时执行
                }
            });
            return button.render();    //按钮渲染
        }
        $(".summernote").summernote({
            height: '450px',
            //设置Dialog淡入淡出效果
            dialogsFade: true,
            fontNames: ['宋体', '微软雅黑', '楷体', '黑体', '隶书', 'Arial', 'Arial Black', 'Comic Sans MS', 'Courier New',
                'Helvetica Neue', 'Helvetica', 'Impact', 'Lucida Grande',
                'Tahoma', 'Times New Roman', 'Verdana'],
            lang: 'zh-CN',
            toolbar: [
                ['style', ['style']],
                //['highlight', ['highlight']],
                //['font', ['bold', 'italic', 'underline', 'clear']],
                ['font', ['bold', 'italic']],
                ['fontname', ['fontname']],
                ['color', ['color']],
                ['para', ['ul', 'ol', 'paragraph', 'height']],
                ['table', ['table']],
                //['insert', ['fileBtn', 'myphoto', 'media', 'link', 'video']],
                ['insert', ['myphoto']],
                ['view', ['fullscreen']]
            ],
            buttons: {
                myphoto: selectImageButton      //自已定义的按钮函数
            },
        })
    </script>
</div>

<div th:fragment="summernote-js-phone">
    <script th:src="@{/ajax/libs/summernote/summernote.js}"></script>
    <script th:src="@{/ajax/libs/summernote/summernote-zh-CN.js}"></script>
    <script th:src="@{/ajax/libs/summernote/summernote-ext-highlight.js}"></script>
    <script>
        //图片上传成功回调方法
        function callBackUploadImg(fileUrl){
            $(".summernote").summernote('editor.insertImage', fileUrl, fileUrl);
        }

        var selectImageButton = function (context) {
            var ui = $.summernote.ui;
            // create button
            var button = ui.button({
                contents: '<i class="note-icon-picture"/>',  //按钮样式
                tooltip: "图片",
                click: function (params) {
                	 layer.open({
                         type: 2,
                         shade: 0.3,
                         title: false,
                         fix: false,
                         area: ['auto','420px'],//$(window).width() / 1.1 + 'px'
                         content: "/blog/blog/image?callBackMethod=window.parent.callBackUploadImg",
                         shadeClose: true,// 是否点击遮罩关闭
                         btn: ['<i class="fa fa-check"></i> 确认', '<i class="fa fa-close"></i> 关闭'],
                         yes: function (index, layero) {
                       	    var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
                       	 	iframeWin.uploadFile();
                         },
                         cancel: function () {
                             return true;
                         }
                     });
                },
                callback: function (params) {
                    // 页面加载时执行
                }
            });
            return button.render();    //按钮渲染
        }
        $(".summernote").summernote({
            height: '450px',
            //设置Dialog淡入淡出效果
            dialogsFade: true,
            fontNames: ['宋体', '微软雅黑', '楷体', '黑体', '隶书', 'Arial', 'Arial Black', 'Comic Sans MS', 'Courier New',
                'Helvetica Neue', 'Helvetica', 'Impact', 'Lucida Grande',
                'Tahoma', 'Times New Roman', 'Verdana'],
            lang: 'zh-CN',
            toolbar: [
                ['style', ['style']],
                ['font', ['bold']],
                ['color', ['color']],
                ['insert', ['myphoto']],
                ['view', ['fullscreen']]
            ],
            buttons: {
                myphoto: selectImageButton      //自已定义的按钮函数
            },
        })
    </script>
</div>

<!-- cropbox图像裁剪插件 -->
<div th:fragment="cropbox-css">
    <link th:href="@{/ajax/libs/cropbox/cropbox.css}" rel="stylesheet"/>
</div>
<div th:fragment="cropbox-js">
    <script th:src="@{/ajax/libs/cropbox/cropbox.js}"></script>
</div>


<!-- fileinput文件上传插件 -->
<div th:fragment="bootstrap-fileinput-css">
    <link th:href="@{/ajax/libs/bootstrap-fileinput/fileinput.min.css}" rel="stylesheet"/>
</div>
<div th:fragment="bootstrap-fileinput-js">
    <script th:src="@{/ajax/libs/bootstrap-fileinput/fileinput.js}"></script>
</div>

<!-- typeahead搜索自动补全 -->
<div th:fragment="bootstrap-typeahead-js">
    <script th:src="@{/ajax/libs/typeahead/bootstrap3-typeahead.min.js}"></script>
</div>

<!-- jsonview格式化和语法高亮JSON格式数据查看插件 -->
<div th:fragment="jsonview-css">
    <link th:href="@{/ajax/libs/jsonview/jquery.jsonview.css}" rel="stylesheet"/>
</div>
<div th:fragment="jsonview-js">
    <script th:src="@{/ajax/libs/jsonview/jquery.jsonview.js}"></script>
</div>

<!-- ECharts百度统计图表插件 -->
<div th:fragment="echarts-js">
    <script th:src="@{/ajax/libs/report/echarts/echarts-all.js}"></script>
</div>

<div th:fragment="bootstrap-tagsinput-css">
    <link th:href="@{/ajax/libs/bootstrap-tagsinput/bootstrap-tagsinput.css}" rel="stylesheet"/>
</div>

<div th:fragment="bootstrap-tagsinput-js">
    <script th:src="@{/ajax/libs/bootstrap-tagsinput/bootstrap-tagsinput.min.js}"></script>
</div>
</html>